﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TeacherConsleApp
{
    class Program
    {
        //static void Main(string[] args)
        //{
        //    Teacherone teacherone = new Teacherone("张三",1229);
        //    teacherone.PE();
        //    CSDN cSDN = new CSDN("图灵",1990);
        //    cSDN.Shou();
        //    Console.WriteLine();

        //    Cat cat = new Cat( "加菲猫");
        //    TestAnimal(cat);
        //    TestPaShu(cat);

        //    Dog dog = new Dog("二哈");
        //    TestAnimal(dog);
        //    dog.Show();

        //    Dusk dusk = new Dusk("唐老鸭");
        //    TestAnimal(dusk);
        //    TestYouYong(dusk);

        //    Monkey monkey = new Monkey( "老孙");
        //    TestAnimal(monkey);
        //    TestPaShu(monkey);
        //}
        //static void TestPaShu(InterfacePaShu interfacePaShu) {
        //    interfacePaShu.PaShu();
        //}
        //static void TestYouYong(InterfaceYouYong interfaceYouYong) {
        //    interfaceYouYong.YouYong();
        //}
        //static void TestAnimal(Animal animal) {
        //    animal.Testeat();
        //}
    }

    //2、猫、狗、鸭、猴，（吃、游泳、爬树）
    class Animal
    {
        
        private string Name;
        public string name{ get => Name; set => Name = value; }

        public Animal(string name)
        {
            this.name = name;
        }
        public void Testeat() {
            Console.Write("干饭！！！！！！     ");
        }
    }

    interface InterfaceYouYong
    {
        void YouYong();
    }

    interface InterfacePaShu
    {
        void PaShu();
    }

    class Cat : Animal, InterfacePaShu
    {
        public Cat(string name) : base(name) { }

        public void Show(){}
        public void PaShu()
        {
            Console.WriteLine("我是一只猫，我的名字是{0},我会爬树", base.name);
        }

    }

    class Dog : Animal
    {
        public Dog(string name) : base( name) { }

        public void Show()
        {
            Console.WriteLine("我是一只狗，我的名字是{0}", base.name);
        }
    }

    class Dusk : Animal, InterfaceYouYong
    {
        public Dusk( string name) : base(name) { }

        public void Show() {}
        public void YouYong()
        {
            Console.WriteLine("我是一只鸭，我的名字是{0},我会游泳",  base.name);
        }

    }

    class Monkey : Animal, InterfacePaShu
    {
        public Monkey( string name) : base( name) { }

        public void Show(){}
        public void PaShu()
        {
            Console.WriteLine("我是一只猴，我的名字是{0},我会爬树", base.name);
        }
    }
}
